﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="CooliteTest.aspx.cs" Inherits="WebUI.CooliteTest" %>

<%@ Register Assembly="Coolite.Ext.Web" Namespace="Coolite.Ext.Web" TagPrefix="ext" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <script type="text/javascript">
        function test() {
            //#{TreePanel1}.render('treeDiv');
            //#{TreePanel1}.root.expand(); 
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
        <ext:ScriptManager ID="ScriptManager1" runat="server">
        </ext:ScriptManager>
        
    <ext:FormPanel ID="FormPanel1" runat="server" BodyStyle="padding:5px;" ButtonAlign="Right"
        Frame="true" Height="185" Title="Title" Width="300">
        <Body>
            <ext:FormLayout ID="FormLayout1" runat="server">
                <ext:Anchor Horizontal="100%">
                    <ext:TextField ID="TextField1" runat="server" FieldLabel="名称">
                    </ext:TextField>                    
                </ext:Anchor>                
                <ext:Anchor Horizontal="100%">
                     <ext:ComboBox ID="ComboBox1" runat="server" FieldLabel="所属区域" TriggerAction="All" Editable="false" Mode="Local">
                        <Items>
                            <ext:ListItem Text="Alabama" Value="AL" />
                            <ext:ListItem Text="Brahms" Value="AK" />
                        </Items>
                        <Template ID="Template1" runat="server">
                           <tpl for='.'><div style='height:200px'><div id='treeDiv'></div></div></tpl>
                        </Template>
                        <Listeners>
                            <Expand Handler="#{TreePanel1}.render('treeDiv');#{TreePanel1}.root.expand();"/>
                            <Blur Handler="#{ComboBox1}.setValue(#{ComboBox1}.tag)" />
                        </Listeners>
                    </ext:ComboBox>                       
                </ext:Anchor>               
            </ext:FormLayout>
        </Body>
        <Buttons>
            <ext:Button ID="Button3" runat="server" Icon="Disk" Text="Submit">
            </ext:Button>
        </Buttons>
    </ext:FormPanel>
        
        
        <ext:Window ID="Window1" runat="server" Icon="World" Title="Title" MinWidth="640px"
            MinHeight="480px" Maximizable="true" Collapsible="True" Visible="false">
            <AutoLoad Url="http://www.baidu.com" Mode="IFrame" />
            <TopBar>
                <ext:Toolbar ID="Toolbar1" runat="server">
                    <Items>
                        <ext:ToolbarFill ID="ctl718" />
                        <ext:ToolbarButton ID="ToolbarButton1" runat="server" Text="Load Google" Icon="Cmy">
                            <Listeners>
                                <Click Handler="#{Window1}.load('http://www.google.com/');#{window1}.Url='http://www.google.com/'" />
                            </Listeners>
                        </ext:ToolbarButton>
                        <ext:ToolbarButton ID="ToolbarButton2" runat="server" Text="Refresh" Icon="ArrowRotateClockwise">
                            <Listeners>
                            </Listeners>
                        </ext:ToolbarButton>
                    </Items>
                </ext:Toolbar>
            </TopBar>            
        </ext:Window>
        
        <ext:Button ID="Button2" runat="server" Text="Submit">
            <Listeners>
                <Click Handler="#{TreePanel1}.root.expand();" />
            </Listeners>
        </ext:Button>
        
        <asp:Button ID="Button1" runat="server" Text="Button" OnClick="Button1_Click" />




    <ext:TreePanel ID="TreePanel1" runat="server" AutoRender="false" Border="false">
        <Root>        
            <ext:TreeNode Text="Composers" Expanded="false" >            
                <Nodes>
                    <ext:TreeNode Text="Beethoven" Icon="UserGray">
                        <Nodes>
                            <ext:TreeNode Text="Concertos">
                                <Nodes>
                                    <ext:TreeNode Text="No. 1 - C" Icon="Music" />
                                    <ext:TreeNode Text="No. 2 - B-Flat Major" Icon="Music" />
                                    <ext:TreeNode Text="No. 3 - C Minor" Icon="Music" />
                                    <ext:TreeNode Text="No. 4 - G Major" Icon="Music" />
                                    <ext:TreeNode Text="No. 5 - E-Flat Major" Icon="Music" />
                                </Nodes>
                            </ext:TreeNode>
                        </Nodes>
                    </ext:TreeNode>
                    <ext:TreeNode Text="Brahms" Icon="UserGray">
                        <Nodes>
                            <ext:TreeNode Text="Concertos">
                                <Nodes>
                                    <ext:TreeNode Text="Violin Concerto" Icon="Music" />
                                    <ext:TreeNode Text="Double Concerto - A Minor" Icon="Music" />
                                    <ext:TreeNode Text="Piano Concerto No. 1 - D Minor" Icon="Music" />
                                    <ext:TreeNode Text="Piano Concerto No. 2 - B-Flat Major" Icon="Music" />
                                </Nodes>
                            </ext:TreeNode>
                            <ext:TreeNode Text="Quartets">
                                <Nodes>
                                    <ext:TreeNode Text="Piano Quartet No. 1 - G Minor" Icon="Music" />
                                    <ext:TreeNode Text="Piano Quartet No. 2 - A Major" Icon="Music" />
                                    <ext:TreeNode Text="Piano Quartet No. 3 - C Minor" Icon="Music" />
                                    <ext:TreeNode Text="Piano Quartet No. 3 - B-Flat Minor" Icon="Music" />
                                </Nodes>
                            </ext:TreeNode>
                        </Nodes>
                    </ext:TreeNode>
                    <ext:TreeNode Text="Mozart" Icon="UserGray">
                        <Nodes>
                            <ext:TreeNode Text="Concertos">
                                <Nodes>
                                    <ext:TreeNode Text="Piano Concerto No. 12" Icon="Music"  />
                                    <ext:TreeNode Text="Piano Concerto No. 17" Icon="Music"  />
                                    <ext:TreeNode Text="Clarinet Concerto" Icon="Music"  />
                                    <ext:TreeNode Text="Violin Concerto No. 5" Icon="Music"  />
                                    <ext:TreeNode Text="Violin Concerto No. 4" Icon="Music"  />
                                </Nodes>
                            </ext:TreeNode>
                        </Nodes>
                    </ext:TreeNode>
                </Nodes>
            </ext:TreeNode>          
        </Root>
        <Listeners>
            <Click Handler="#{ComboBox1}.setValue(node.text);#{ComboBox1}.tag=node.text;#{ComboBox1}.collapse();" />
        </Listeners>
    </ext:TreePanel>
        
    </form>
</body>
</html>
